<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改广告</title>
    
	<link href="css/css.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
	<script src="js/jquery-1.9.0.js"></script>
	<script src="js/jquery.validate.min.js"></script>
	<script src="js/WarnMessages.js"></script>
	<!-- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>   -->
	<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  
  	<script type="text/javascript" charset="utf-8" src="ueditor/editor_config.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor/editor_all.js"></script>
	<style type="text/css">
		<!--
		.atten {font-size:12px;font-weight:normal;color:#F00;}
		-->
	</style>
	<script type="text/javascript" language="javascript">
        $(function() {    
			$( "#txtDate" ).datepicker({ dateFormat: "yy-mm-dd" }); 
			$( "#txtDate1" ).datepicker({ 
				dateFormat: "yy-mm-dd"
				
	    	});  
		}); 
		
			/*****以下是表单验证****/
$(function(){
	
	$("#myform").validate({
	rules:{
			'beginDate':{
			required:true
			},
			'endDate':{
			required:true
			},
			'ads.adsName':{
			required:true
			},
			'ads.url':{
			required:true
			},
			'ads.adsPosId':{
			required:true
			},
			'upload':{
			required:true
			},
			'ads.remarks':{
			required:true
			}
		}
	});
    });
    /*****以上是表单验证****/	
		
    </script>
</head>

<body class="ContentBody">
<form  id="myform" action="admin/updateAds" method="post" enctype="multipart/form-data">
	<div class="MainDiv">
	<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
	  <tr>
	      <th class="tablestyle_title" >添加广告内容</th>
	  </tr>
 	  <tr>
	    <td class="CPanel">
			<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
				<tr>
					<td width="100%">
						<fieldset style="height:100%;">
						<legend>更新广告信息</legend>  
						<input type="hidden" name="adsIdStr" value="${adsInfo.adsId }"/>
							  <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
							  	   <tr>
									    <td align="right" height="30px" width="11%">开始时间:<input type="hidden" name="ads.adsId" value="${adsInfo.adsId }"/></td>
									    <td>
									    	<input type="text" id="txtDate" name="beginDate" value="${adsInfo.beginDate }"/>
									    	结束时间:<input type="text" id="txtDate1" name="endDate" value="${adsInfo.endDate }"/>
									    </td>
								   </tr>
								
								   <tr>
									    <td align="right" height="50px" width="11%">广告标题:</td>
									    <td>
									    	<input name="ads.adsName" style="height:23px;" value="${adsInfo.adsName }" type="text" class="text"  size="95"/>
									    </td>
								   </tr>
								    <tr>
									    <td align="right" height="50px" width="11%">广告链接地址:</td>
									    <td>
									    	<input name="ads.url" style="height:23px;" value="${adsInfo.url }" type="text" class="text"  size="95"/>
									    </td>
								   </tr>
								   <tr>
									    <td align="right" height="50px" width="11%">选择广告位置:</td>
									    <td>
									    	<input type="text" id="adsPos" value="${adsInfo.adsPosId }">
									    </td>
								   </tr>
								   <tr>
									    <td align="right" height="50px" width="11%">选择广告图片:</td>
									    <td>
									    	<input type="file" name="upload" style="height:23px;" class="text"  size="80"/>
									    </td>
								   </tr>
								   
							       <tr>
								       	<td align="right">广告内容备注:</td>
								       	<td>
								      	 	<textArea id="editor" name="ads.remarks" value="${adsInfo.remarks }"  type="text/plain">这里可以书写，编辑器的初始内容</textArea>
										</td>
							       </tr>
							       <tr>
							    		<td colspan="3"   style="text-align: center;"  height="10" align="right" bgcolor="#FFFFFF">
							    			<input class="right-button02" type="button" name="back" id="back" onclick="window.history.go(-1);" value="返回"/>
							    		</td>
                    				</tr>
							       <tr>
							       		<td>&nbsp;</td>
							       		<td>&nbsp;</td>
							       </tr>
							       <tr>
							       		<td>&nbsp;</td>
										<td align="left">
											<input type="submit" value="提交" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="reset" value="重置" />
										</td>
									</tr>
							  </table>
					  <br/>
						</fieldset>			
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
				
				
			</table>
		</td>
	  </tr>
	  </table>
</div>	
</form>						   
</body>
<script type="text/javascript" language="javascript">
//实例化编辑器
var ue = UE.getEditor('editor');
    ue.addListener('ready',function(){
    this.focus();
});
</script>
</html>
